<?php

namespace app\controller;

use app\model\SystemLog;
use support\Request;

class SystemLogController
{

    protected $noNeedLogin = [];
    public function index()
    {
        try {
            $result = SystemLog::order('id desc')->select();
            return json(["code" => 200, "msg" => "系统日志获取成功", "data" => $result]);
        } catch (\Exception $e) {
            return json(["code" => 400, "msg" => "获取失败"]);
        }
    }

    public function delete()
    {
        try {
            $result = SystemLog::where(1,1)->delete();
            return json(["code" => 200, "msg" => "系统日志清空成功", "data" => $result]);
        } catch (\Exception $e) {
            return json(["code" => 400, "msg" => "获取失败"]);
        }
    }

}
